package client.view;

import java.io.Serializable;
import java.rmi.RemoteException;

import server.model.meeting.Message;
import server.model.remotes.IMeeting;
import client.remotes.ICommunicator;

public class ClientMeeting{
	
	private MeetingGui meetingGui;
	private ICommunicator communicator;
	private IMeeting meeting;	
	
	public ClientMeeting(String username, IMeeting meeting)
	{
		
		try {
			meetingGui = new MeetingGui(this, username);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		this.meeting = meeting;		

	}

	public ICommunicator getCommunicator() {
		return meetingGui;
	}

	public void sendMessage(Message message) {
		try {
			meeting.distributeMessage(message);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		
	}
}